﻿#region Librerias

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using ESF.SSO.Presenter.Client;
using ESF.Web.Pages;
using ESF.General.Entity;
using ESF.Web;
using ESF.General;
using ESF.SSO.Core.Entities.BasicReferences;

#endregion


public partial class RecoverPassword : BasePagePresenter<RecoverPasswordPresenter>, IRecoverPasswordViewer
{
	#region Carga Inicial
	
	protected void Page_Load(object sender, EventArgs e)
	{
		_Presenter = new RecoverPasswordPresenter (this);
		
		if (!IsPostBack)
		{
			ListLoader.LoadList (ddlUserSecurityQuestion, WebGeneral.ListBasicReference (BasicReferenceTypes.SecurityQuestion));

			_Presenter.Load ();
		}
	}
	
	#endregion
	

	#region Eventos
	
	protected void btnRecoverPassword_Click(object sender, EventArgs e)
	{
		_Presenter.RecoverPassword ();
	}
	
	#endregion


	#region Miembros de IRecoverPasswordViewer

	public string UserEmail
	{
		get { return txtUserEmail.Text; }
		set { txtUserEmail.Text = value; }
	}

	public string UserSecurityAnswer
	{
		get { return txtUserSecurityAnswer.Text; }
		set { txtUserSecurityAnswer.Text = value; }
	}
	
	public int? UserSecurityQuestionID
	{
		set { ListLoader.Select (ddlUserSecurityQuestion, value); }
		get { return TextHelper.GetNullableInt (ddlUserSecurityQuestion.SelectedValue); }
	}

	#endregion
}